package org.jeecg.modules.business.enums;
        import org.jeecg.common.system.annotation.EnumDict;
        import org.jeecg.common.system.vo.DictModel;

        import java.util.ArrayList;
        import java.util.List;

@EnumDict("AgreementOrderTypeEnum")
public enum AgreementOrderTypeEnum {
    PAYMENT(1,"收款"),
    REFUND(2,"退款"),
    GOODS_ONSUME(3,"商品消费"),
    RETURN_GOODS(4,"退货"),
    SETTLEMENT(5,"结算"),
    REVERSE_ENTRY(6,"冲账"),;

    Integer key;

    String title;

    AgreementOrderTypeEnum(Integer key, String title){
        this.key = key;
        this.title = title;
    }
    public Integer getKey() {
        return key;
    }

    public String getTitle() {
        return title;
    }

    /**
     * 获取字典数据
     * @return
     */
    public static List<DictModel> getDictList(){
        List<DictModel> list = new ArrayList<>();
        DictModel dictModel = null;
        for(CouponsEventEnum e: CouponsEventEnum.values()){
            dictModel = new DictModel();
            dictModel.setValue(e.key.toString());
            dictModel.setText(e.title);
            list.add(dictModel);
        }
        return list;
    }

    public static AgreementOrderTypeEnum val(Integer key){
        for(AgreementOrderTypeEnum bld: values()){
            if(bld.key .equals(key)){
                return bld;
            }
        }
        return null;
    }
}

